home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Corel Professional Photos 402: The Masters 4
/
Corel Stock Photo Library 2 - 402 - The Masters IV.iso
/
drwmodel
/
programs
/
data
/
resource.ps
< prev
next >
Wrap
Text File
|
1994-04-19
|
100KB
|
3,632 lines
$resource begin
userdict begin /EncodingDirectory 5 dict def end
true setglobal
currentdict /CategoryDICT 20 dict put
% Dictionary to hold the global resources
currentdict /GlobalRDicts
<<
/Category 20 dict
/Font GlobalFontDirectory
/Encoding 5 dict
/Form 5 dict
/Pattern 5 dict
/ProcSet 5 dict
/ColorSpace 10 dict
/Halftone 5 dict
/ColorRendering 5 dict
/Filter 14 dict
/ColorSpaceFamily 5 dict
/Emulator 5 dict
/IODevice 5 dict
/ColorRenderingType 5 dict
/FMapType 5 dict
/FontType 5 dict
/FormType 5 dict
/HalftoneType 5 dict
/ImageType 5 dict
/PatternType 2 dict
/Generic 0 dict
>> put
% Dictionary to hold the info returned by ResourceStatus for global resources
currentdict /GlobalSDicts
<<
/Category 20 dict
/Font 40 dict
/Encoding 5 dict
/Form 5 dict
/Pattern 5 dict
/ProcSet 5 dict
/ColorSpace 10 dict
/Halftone 5 dict
/ColorRendering 5 dict
/Filter 14 dict
/ColorSpaceFamily 5 dict
/Emulator 5 dict
/IODevice 5 dict
/ColorRenderingType 5 dict
/FMapType 5 dict
/FontType 5 dict
/FormType 5 dict
/HalftoneType 5 dict
/ImageType 5 dict
/PatternType 2 dict
/Generic 0 dict
>> put
false setglobal
% Dictionary to hold the local resources
currentdict /LocalRDicts
<<
/Category 20 dict
/Font FontDirectory
/Encoding EncodingDirectory
/Form 5 dict
/Pattern 5 dict
/ProcSet 5 dict
/ColorSpace 10 dict
/Halftone 5 dict
/ColorRendering 5 dict
/Generic 0 dict
>> put
% Dictionary to hold the info returned by ResourceStatus for local resources
currentdict /LocalSDicts
<<
/Category 20 dict
/Font 40 dict
/Encoding 5 dict
/Form 5 dict
/Pattern 5 dict
/ProcSet 5 dict
/ColorSpace 10 dict
/Halftone 5 dict
/ColorRendering 5 dict
/Generic 0 dict
>> put
currentdict /KeyAccessTest {
$resource begin
/matched false def
[/arraytype /stringtype /packedarraytype /dicttype /filetype]
{/key load type eq matched or /matched exch def } forall
matched {
$resource /key get rcheck not {
currentdict /matched undef
$resource /key load $resource /key undef
end /findencoding /invalidaccess err
} if
} if
currentdict /matched undef
end
} put
currentdict /err { currentdict /key undef false setglobal /_err exch def
/_cmd exch def $error begin /newerror true def
/errorname _err def /command _cmd cvx def
end end stop} put
true setglobal
% CATEGORY
/Category
<<
/InstanceType /dicttype /Category /Category
/err { currentdict /key undef false setglobal /_err exch def
/_cmd exch def $error begin /newerror true def
/errorname _err def /command _cmd cvx def end end stop}
/ResourceForAll {
genericresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentglobal {
currentdict /GlobalSDicts get category get /sdict exch def
sdict length 0 eq {
false
} {
sdict begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} {
currentdict /LocalSDicts get category get /sdict exch def
sdict length 0 eq {
currentdict /GlobalSDicts get category get length 0 eq {
false
} {
currentdict /GlobalSDicts get category get begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} {
currentdict /LocalSDicts get category get length 0 eq {
false
} {
currentdict /LocalSDicts get category get begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} ifelse
} ifelse
$resource /key undef $resource /sdict undef
$resource /category undef
end
}
/ResourceFileName {
(Resource/Category/) genericresourcefile
}
/UndefineResource {
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
% always delete from local vm dictionary
currentdict /LocalRDicts get category get length 0 ne {
currentdict /LocalRDicts get category get
begin
currentdict /key load undef
end
} if
currentdict /LocalSDicts get category get length 0 ne {
currentdict /LocalSDicts get category get
begin
currentdict /key load undef
end
} if
currentglobal { % if global vm, delete
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
$resource /CategoryDICT get $resource /key get undef
end
currentdict /GlobalSDicts get category get
begin
currentdict /key load undef
end
} if
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 2 lt {
/FindResource /stackunderflow err
} if
% Actually, we don't want to ditch the category name. We want to search for
% a disk-based resource within the subdirectory named for the category...
% Encodings, for instance in /encodings.
pop % ditch the category name
$resource exch /key exch put
$resource begin
currentdict /GlobalRDicts get /Category get /rdict exch def
rdict key known not {
% here we will later insert code to search for files containing
% the stuff. Be sure to update the ResourceStatusDict also !!
end /FindResource /undefinedresource err
} if
% currentdict key get
% $resource /CategoryDICT get $resource /key get get
rdict key get
currentdict /key undef currentdict /rdict undef
end
}
/DefineResource {
$resource /initialize known not {
currentglobal not {
/DefineResource /invalidaccess err
} if
} if
count 3 lt {
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
/inst exch def
$resource /initialize known not {
/newcategory true def
} {
/newcategory false def
} ifelse
currentglobal {
currentdict /GlobalRDicts get category get /rrdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
currentdict /GlobalRDicts get /rdict exch def
} {
currentdict /LocalRDicts get category get /rrdict exch def
currentdict /LocalSDicts get category get /sdict exch def
currentdict /LocalRDicts get /rdict exch def
} ifelse
inst type currentdict /insttype get ne {
end /DefineResource /typecheck err
} if
/key exch def
inst /Validate where {
/Validate get exec
} {
end /DefineResource /typecheck err
} ifelse
currentglobal {
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
} if
% put it into the global dictionary in the resource dictionary
$resource /CategoryDICT get key inst put
% store a copy of the dict in the Category dict in GlobalRDict so that
% resourceforall can grab it.
currentdict /rrdict get key inst put
currentdict /GlobalSDicts get /Category get $resource /key get [0 -1 true] put
% $resource key inst put
% currentdict /sdict get key [0 -1 true] put
newcategory { %% make global/local status/resource dict entries
rdict key 10 dict put
false setglobal
currentdict /LocalSDicts get /sdict exch def
currentdict /LocalRDicts get /rdict exch def
rdict key 10 dict put
sdict key 10 dict put
currentdict /LocalSDicts get /Category get $resource /key get [0 -1 true] put
true setglobal
} if
inst
$resource /initialize known not {
readonly
} if
currentdict /inst undef currentdict /key undef
currentdict /rdict undef currentdict /sdict undef
currentdict /insttype undef currentdict /newcategory undef
currentdict /rrdict undef
end
}
/Validate {
[/DefineResource /UndefineResource /FindResource /ResourceStatus
/ResourceForAll /Category ] {
1 index exch known not {
/DefineResource /typecheck err
} if
} forall
pop
}
>>
def
CategoryDICT /Category Category put
$resource /GlobalRDicts get /Category CategoryDICT put
/initialize true def
end
% Regular Resources
% FONT
/Font
<<
/InstanceType /dicttype /Category /Font
/err {currentdict /key undef false setglobal
/_err exch def /_cmd exch def $error begin /newerror true def
/errorname _err def /command _cmd cvx def end stop}
/ResourceForAll {
genericresourceforall
}
/ResourceFileName {
(fonts/) genericresourcefile
% Moved into systemdict.h, as genericresourcefilename operator.
% exch dup length
% 3 1 roll exch
% dup (fonts/) dup length
% 6 1 roll
% 0 exch putinterval
% dup 3 1 roll exch 4 index exch
% =string cvs putinterval
% 3 1 roll add 0 exch getinterval
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentglobal { % global, look only in global stat dict
currentdict /GlobalSDicts get category get /sdict exch def
sdict length 0 eq {
false
} {
sdict begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} { % look in the local first, then the global dict
currentdict /LocalSDicts get category get /sdict exch def
sdict length 0 eq { % no local dict for this
currentdict /GlobalSDicts get category get length 0 eq {
false
} { % look in the global status dictionary
currentdict /GlobalSDicts get category get begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} { % look first in the local dict
currentdict /LocalSDicts get category get begin
currentdict /key load known not { % not in the local stat dict
end
currentdict /GlobalSDicts get category get begin
currentdict /key load known not { % not in global stat dict
false
}{
currentdict /key load get {} forall
} ifelse
} { % found in the local dict
currentdict /key load get {} forall
} ifelse
end
} ifelse
} ifelse
$resource /key undef $resource /sdict undef
$resource /category undef
end
}
/UndefineResource {
pop
dup $resource exch /key exch put
undefinefont
$resource begin
currentdict /LocalSDicts get /Font get length 0 ne {
currentdict /LocalSDicts get /Font get
begin
currentdict $resource /key get undef
end
currentdict /LocalSDicts get /Font get
begin
currentdict $resource /key get undef
end
} if
currentglobal { % if global vm, delete
currentdict /GlobalSDicts get /Font get length 0 ne { % from global dict
currentdict /GlobalSDicts get /Font get
begin
currentdict $resource /key get undef
end
currentdict /GlobalSDicts get /Font get
begin
currentdict $resource /key get undef
end
} if
} if
$resource /key undef
end
}
/FindResource {
count 2 lt {
/FindResource /stackunderflow err
} if
pop
10 dict begin
/_kkeeyy exch def
$resource /LocalRDicts get /Font FontDirectory put
/rdict FontDirectory def
$resource /LocalSDicts get /Font get /sdict exch def
rdict /_kkeeyy known not currentglobal and {
$resource /GlobalRDicts get /Font GlobalFontDirectory put
/rdict GlobalFontDirectory def
$resource /GlobalSDicts get /Font get /sdict exch def
} if
rdict /_kkeeyy known not {
/global currentglobal def
{ mark /_kkeeyy load userdict begin _findfont cleartomark } stopped {
end
cleartomark
/_kkeeyy load =string cvs print
( not found; using Times-Roman\r\n) print flush
/Times-Roman _findfont
} {
end
rdict /_kkeeyy load get
} ifelse
global setglobal
%% only do this when an explicit findfont is done!!
sdict /_kkeeyy load [1 -1 true] put
}{
rdict /_kkeeyy get
} ifelse
end
}
/DefineResource {
pop % the name of the category needs to be popped off
1 index exch
{ xdefinefont } stopped {
end % on the dictionary defineresource began
/DefineResource /definefont err
} if
exch
AddStatusInfo
}
/AddStatusInfo {
/key exch dup type /stringtype eq {cvn} if def
currentglobal {
$resource /GlobalSDicts get /Font get /key load [0 -1 true] put
} if
$resource /LocalSDicts get /Font get /key load [0 -1 true] put
}
>> /Category
defineresource pop
% ENCODING
/Encoding
<<
/InstanceType /arraytype /Category /Encoding
/err $resource /err get def
/ResourceForAll {
genericresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentglobal {
currentdict /GlobalSDicts get category get /sdict exch def
sdict length 0 eq {
false
} {
sdict begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} { % local VM mode
currentdict /LocalSDicts get category get /sdict exch def
sdict length 0 eq { % 0 length local status dict -- look at glob stat dict
currentdict /GlobalSDicts get category get length 0 eq {
false % 0 length global status dict
} {
currentdict /GlobalSDicts get category get begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} { % local status dict has something in it
currentdict /LocalSDicts get category get begin
currentdict /key load known not { % not in the local stat dict
end
currentdict /GlobalSDicts get category get begin
currentdict /key load known not { % not in global stat dict
false
}{
currentdict /key load get {} forall
} ifelse
} { % found in the local dict
currentdict /key load get {} forall
} ifelse
end
} ifelse
} ifelse
$resource /key undef $resource /sdict undef
$resource /category undef
end
}
/ResourceFileName {
(encodings/) genericresourcefile
} def
/UndefineResource {
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
% always delete from local vm dictionary
currentdict /LocalRDicts get category get length 0 ne {
currentdict /LocalRDicts get category get
begin
currentdict /key load undef
end
currentdict /LocalSDicts get category get
begin
currentdict /key load undef
end
} if
currentglobal { % if global vm, delete
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
currentdict /GlobalSDicts get category get
begin
currentdict /key load undef
end
} if
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 2 lt { % Must have two args.
/findencoding /stackunderflow err
} if
exch $resource exch
/key exch dup type /arraytype eq { % get the key. If it's a proc,
dup xcheck { % stuff the array into another array
1 array astore cvx % before defining key
} if
} if
put
$resource /key get type /nulltype eq { % generate a complaint if null
$resource /key get
/findencoding /typecheck err
} if
$resource /KeyAccessTest get exec % check the access of key if composite
$resource begin
/category exch def
currentglobal { % Check Global resource dict. If not found, check disk.
currentdict /GlobalRDicts get category get /rdict exch def
rdict key known not {
key finddiskencoding
} if
} { % Check Local resource dict.
currentdict /LocalRDicts get category get /rdict exch def
rdict key known not { % Not found. Check Global dict.
currentdict /GlobalRDicts get category get /rdict exch def
rdict key known not { % Not found. Load into Local from disk.
currentdict /LocalRDicts get category get /rdict exch def
key finddiskencoding
} if
} if
} ifelse
rdict key known not {
userdict /EncodingDirectory get key known not {
end $resource /key get /findencoding /undefinedresource err
} {
userdict /EncodingDirectory get key get
} ifelse
} {
rdict key get
} ifelse
currentdict /rdict undef
currentdict /category undef
currentdict /key undef
end
}
/DefineResource {
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
currentdict /LocalRDicts get category get /lrdict exch def
currentdict /LocalSDicts get category get /lsdict exch def
} {
currentdict /LocalRDicts get category get /rdict exch def
currentdict /LocalSDicts get category get /sdict exch def
} ifelse
/inst exch readonly def % make the instance readonly
/key exch def
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
currentdict /lrdict get /nulltype ne { % if local dict exists
currentdict /lrdict get key undef % delete any entry with
currentdict /lsdict get key undef % this key
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 -1 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
currentdict /category undef currentdict /insttype undef
end
}
>> /Category defineresource pop
% FORM
/Form
<<
/InstanceType /dicttype /Category /Form
/err $resource /err get def
/ResourceForAll {
genericresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentglobal {
currentdict /GlobalSDicts get category get /sdict exch def
sdict length 0 eq {
false
} {
sdict begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} { % local VM mode
currentdict /LocalSDicts get category get /sdict exch def
sdict length 0 eq { % 0 length local status dict -- look at glob stat dict
currentdict /GlobalSDicts get category get length 0 eq {
false % 0 length global status dict
} {
currentdict /GlobalSDicts get category get begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} { % local status dict has something in it
currentdict /LocalSDicts get category get begin
currentdict /key load known not { % not in the local stat dict
end
currentdict /GlobalSDicts get category get begin
currentdict /key load known not { % not in global stat dict
false
}{
currentdict /key load get {} forall
} ifelse
} { % found in the local dict
currentdict /key load get {} forall
} ifelse
end
} ifelse
} ifelse
$resource /key undef $resource /sdict undef
$resource /category undef
end
}
/ResourceFileName {
(Resource/Form/) genericresourcefile
}
/UndefineResource {
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
% always delete from local vm dictionary
currentdict /LocalRDicts get category get length 0 ne {
currentdict /LocalRDicts get category get
begin
currentdict /key load undef
end
currentdict /LocalSDicts get category get
begin
currentdict /key load undef
end
} if
currentglobal { % if global vm, delete
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
currentdict /GlobalSDicts get category get
begin
currentdict /key load undef
end
} if
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 2 lt { % too few arguments
/findencoding /stackunderflow err
} if
exch $resource exch
/key exch dup type /arraytype eq { % get the key. If it's a proc,
dup xcheck { % stuff the array into another array
1 array astore cvx % before defining key
} if
} if
put
$resource /key get type /nulltype eq { % generate a complaint if null
$resource /key get
/findencoding /typecheck err
} if
$resource /KeyAccessTest get exec % check the access of key if composite
$resource begin
/category exch def
currentglobal { % if global vm active
currentdict /GlobalRDicts get category get /rdict exch def
} { % local vm, check local vm, then global
currentdict /LocalRDicts get category get length 0 eq {
currentdict /GlobalRDicts get category get length 0 eq {
% here we will later insert code to search for files containing
% the stuff
end $resource /key get /findencoding /undefinedresource err
} if
currentdict /GlobalRDicts get category get /rdict exch def
} {
currentdict /LocalRDicts get category get /rdict exch def
} ifelse
} ifelse
rdict begin
currentdict /key load known not { % didn't find in the first dict search
end
currentglobal { % if global vm, all done
% here we will later insert code to search for files containing
% the stuff. Be sure to update the ResourceStatusDict also !!
end $resource /key get /findencoding /undefinedresource err
} if
currentdict /GlobalRDicts get category get length 0 eq {
end /key load /findencoding /undefinedresource err % all done
} if
% now search the global dictionary */
currentdict /GlobalRDicts get category get /rdict exch def
rdict /key load known not {
end $resource /key load /findencoding /undefinedresource err
} if
currentdict /rdict get
begin
} if
currentdict /key load get
end
currentdict /key undef
currentdict /rdict undef
currentdict /category undef
end %$resource
}
/DefineResource {
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
currentdict /LocalRDicts get category get /lrdict exch put
currentdict /LocalSDicts get category get /lsdict exch put
} {
currentdict /LocalRDicts get category get /rdict exch def
currentdict /LocalSDicts get category get /sdict exch def
} ifelse
/inst exch readonly def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
currentdict /lrdict get /nulltype ne { % if local dict exists
currentdict /lrdict get key undef % delete any entry with
currentdict /lsdict get key undef % this key
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 -1 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
currentdict /category undef currentdict /insttype undef
end
}
>> /Category defineresource pop
% PATTERN
/Pattern
<<
/InstanceType /dicttype /Category /Pattern
/err $resource /err get def
/ResourceForAll {
genericresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentglobal {
currentdict /GlobalSDicts get category get /sdict exch def
sdict length 0 eq {
false
} {
sdict begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} { % local VM mode
currentdict /LocalSDicts get category get /sdict exch def
sdict length 0 eq { % 0 length local status dict -- look at glob stat dict
currentdict /GlobalSDicts get category get length 0 eq {
false % 0 length global status dict
} {
currentdict /GlobalSDicts get category get begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} { % local status dict has something in it
currentdict /LocalSDicts get category get begin
currentdict /key load known not { % not in the local stat dict
end
currentdict /GlobalSDicts get category get begin
currentdict /key load known not { % not in global stat dict
false
}{
currentdict /key load get {} forall
} ifelse
} { % found in the local dict
currentdict /key load get {} forall
} ifelse
end
} ifelse
} ifelse
$resource /key undef $resource /sdict undef
$resource /category undef
end
}
/ResourceFileName {
(Resource/Pattern/) genericresourcefile
}
/UndefineResource {
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
% always delete from local vm dictionary
currentdict /LocalRDicts get category get length 0 ne {
currentdict /LocalRDicts get category get
begin
currentdict /key load undef
end
currentdict /LocalSDicts get category get
begin
currentdict /key load undef
end
} if
currentglobal { % if global vm, delete
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
currentdict /GlobalSDicts get category get
begin
currentdict /key load undef
end
} if
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 2 lt { % too few arguments
/findencoding /stackunderflow err
} if
exch $resource exch
/key exch dup type /arraytype eq { % get the key. If it's a proc,
dup xcheck { % stuff the array into another array
1 array astore cvx % before defining key
} if
} if
put
$resource /key get type /nulltype eq { % generate a complaint if null
$resource /key get
/findencoding /typecheck err
} if
$resource /KeyAccessTest get exec % check the access of key if composite
$resource begin
/category exch def
currentglobal { % if global vm active
currentdict /GlobalRDicts get category get /rdict exch def
} { % local vm, check local vm, then global
currentdict /LocalRDicts get category get length 0 eq {
currentdict /GlobalRDicts get category get length 0 eq {
% here we will later insert code to search for files containing
% the stuff
end $resource /key get /findencoding /undefinedresource err
} if
currentdict /GlobalRDicts get category get /rdict exch def
} {
currentdict /LocalRDicts get category get /rdict exch def
} ifelse
} ifelse
rdict begin
currentdict /key load known not { % didn't find in the first dict search
end
currentglobal { % if global vm, all done
% here we will later insert code to search for files containing
% the stuff. Be sure to update the ResourceStatusDict also !!
end $resource /key get /findencoding /undefinedresource err
} if
currentdict /GlobalRDicts get category get length 0 eq {
end /key load /findencoding /undefinedresource err % all done
} if
% now search the global dictionary */
currentdict /GlobalRDicts get category get /rdict exch def
rdict /key load known not {
end $resource /key load /findencoding /undefinedresource err
} if
currentdict /rdict get
begin
} if
currentdict /key load get
end
currentdict /key undef
currentdict /rdict undef
currentdict /category undef
end %$resource
}
/DefineResource {
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
currentdict /LocalRDicts get category get /lrdict exch put
currentdict /LocalSDicts get category get /lsdict exch put
} {
currentdict /LocalRDicts get category get /rdict exch def
currentdict /LocalSDicts get category get /sdict exch def
} ifelse
/inst exch readonly def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
currentdict /lrdict get /nulltype ne { % if local dict exists
currentdict /ldict get key undef % delete any entry with
currentdict /lsdict get key undef % this key
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 -1 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
currentdict /category undef currentdict /insttype undef
end
}
>> /Category defineresource pop
% PROCSET
/ProcSet
<<
/InstanceType /dicttype /Category /ProcSet
/err $resource /err get def
/ResourceForAll {
genericresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentglobal {
currentdict /GlobalSDicts get category get /sdict exch def
sdict length 0 eq {
false
} {
sdict begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} { % local VM mode
currentdict /LocalSDicts get category get /sdict exch def
sdict length 0 eq { % 0 length local status dict -- look at glob stat dict
currentdict /GlobalSDicts get category get length 0 eq {
false % 0 length global status dict
} {
currentdict /GlobalSDicts get category get begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} { % local status dict has something in it
currentdict /LocalSDicts get category get begin
currentdict /key load known not { % not in the local stat dict
end
currentdict /GlobalSDicts get category get begin
currentdict /key load known not { % not in global stat dict
false
}{
currentdict /key load get {} forall
} ifelse
} { % found in the local dict
currentdict /key load get {} forall
} ifelse
end
} ifelse
} ifelse
$resource /key undef $resource /sdict undef
$resource /category undef
end
}
/ResourceFileName {
(Resource/ProcSet/) genericresourcefile
}
/UndefineResource {
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
% always delete from local vm dictionary
currentdict /LocalRDicts get category get length 0 ne {
currentdict /LocalRDicts get category get
begin
currentdict /key load undef
end
currentdict /LocalSDicts get category get
begin
currentdict /key load undef
end
} if
currentglobal { % if global vm, delete
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
currentdict /GlobalSDicts get category get
begin
currentdict /key load undef
end
} if
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 2 lt { % too few arguments
/findencoding /stackunderflow err
} if
exch $resource exch
/key exch dup type /arraytype eq { % get the key. If it's a proc,
dup xcheck { % stuff the array into another array
1 array astore cvx % before defining key
} if
} if
put
$resource /key get type /nulltype eq { % generate a complaint if null
$resource /key get
/findencoding /typecheck err
} if
$resource /KeyAccessTest get exec % check the access of key if composite
$resource begin
/category exch def
currentglobal { % if global vm active
currentdict /GlobalRDicts get category get /rdict exch def
} { % local vm, check local vm, then global
currentdict /LocalRDicts get category get length 0 eq {
currentdict /GlobalRDicts get category get length 0 eq {
% here we will later insert code to search for files containing
% the stuff
end $resource /key get /findencoding /undefinedresource err
} if
currentdict /GlobalRDicts get category get /rdict exch def
} {
currentdict /LocalRDicts get category get /rdict exch def
} ifelse
} ifelse
rdict begin
currentdict /key load known not { % didn't find in the first dict search
end
currentglobal { % if global vm, all done
% here we will later insert code to search for files containing
% the stuff. Be sure to update the ResourceStatusDict also !!
end $resource /key get /findencoding /undefinedresource err
} if
currentdict /GlobalRDicts get category get length 0 eq {
end /key load /findencoding /undefinedresource err % all done
} if
% now search the global dictionary */
currentdict /GlobalRDicts get category get /rdict exch def
rdict /key load known not {
end $resource /key load /findencoding /undefinedresource err
} if
currentdict /rdict get
begin
} if
currentdict /key load get
end
currentdict /key undef
currentdict /rdict undef
currentdict /category undef
end %$resource
}
/DefineResource {
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
currentdict /LocalRDicts get category get /lrdict exch def
currentdict /LocalSDicts get category get /lsdict exch def
} {
currentdict /LocalRDicts get category get /rdict exch def
currentdict /LocalSDicts get category get /sdict exch def
} ifelse
/inst exch readonly def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
currentdict /lrdict get /nulltype ne { % if local dict exists
currentdict /lrdict get key undef % delete any entry with
currentdict /lsdict get key undef % this key
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 -1 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
currentdict /category undef currentdict /insttype undef
end
}
>> /Category defineresource pop
% COLORSPACE
/ColorSpace
<<
/InstanceType /arraytype /Category /ColorSpace
/err $resource /err get def
/ResourceForAll {
genericresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentglobal {
currentdict /GlobalSDicts get category get /sdict exch def
sdict length 0 eq {
false
} {
sdict begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} { % local VM mode
currentdict /LocalSDicts get category get /sdict exch def
sdict length 0 eq { % 0 length local status dict -- look at glob stat dict
currentdict /GlobalSDicts get category get length 0 eq {
false % 0 length global status dict
} {
currentdict /GlobalSDicts get category get begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} { % local status dict has something in it
currentdict /LocalSDicts get category get begin
currentdict /key load known not { % not in the local stat dict
end
currentdict /GlobalSDicts get category get begin
currentdict /key load known not { % not in global stat dict
false
}{
currentdict /key load get {} forall
} ifelse
} { % found in the local dict
currentdict /key load get {} forall
} ifelse
end
} ifelse
} ifelse
$resource /key undef $resource /sdict undef
$resource /category undef
end
}
/ResourceFileName {
(Resource/ColorSpace/) genericresourcefile
}
/UndefineResource {
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
% always delete from local vm dictionary
currentdict /LocalRDicts get category get length 0 ne {
currentdict /LocalRDicts get category get
begin
currentdict /key load undef
end
currentdict /LocalSDicts get category get
begin
currentdict /key load undef
end
} if
currentglobal { % if global vm, delete
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
currentdict /GlobalSDicts get category get
begin
currentdict /key load undef
end
} if
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 2 lt { % too few arguments
/findencoding /stackunderflow err
} if
exch $resource exch
/key exch dup type /arraytype eq { % get the key. If it's a proc,
dup xcheck { % stuff the array into another array
1 array astore cvx % before defining key
} if
} if
put
$resource /key get type /nulltype eq { % generate a complaint if null
$resource /key get
/findencoding /typecheck err
} if
$resource /KeyAccessTest get exec % check the access of key if composite
$resource begin
/category exch def
currentglobal { % if global vm active
currentdict /GlobalRDicts get category get /rdict exch def
} { % local vm, check local vm, then global
currentdict /LocalRDicts get category get length 0 eq {
currentdict /GlobalRDicts get category get length 0 eq {
% here we will later insert code to search for files containing
% the stuff
end $resource /key get /findencoding /undefinedresource err
} if
currentdict /GlobalRDicts get category get /rdict exch def
} {
currentdict /LocalRDicts get category get /rdict exch def
} ifelse
} ifelse
rdict begin
currentdict $resource /key get known not { % didn't find in the first dict search
end
currentglobal { % if global vm, all done
% here we will later insert code to search for files containing
% the stuff. Be sure to update the ResourceStatusDict also !!
end $resource /key get /findencoding /undefinedresource err
} if
currentdict /GlobalRDicts get category get length 0 eq {
end $resource /key get /findencoding /undefinedresource err % all done
} if
% now search the global dictionary */
currentdict /GlobalRDicts get category get /rdict exch def
rdict $resource /key get known not {
end $resource dup /key get /findencoding /undefinedresource err
} if
currentdict /rdict get
begin
} if
currentdict $resource /key get get
end
currentdict /key undef
currentdict /rdict undef
currentdict /category undef
end %$resource
}
/DefineResource {
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
currentdict /LocalRDicts get category get /lrdict exch put
currentdict /LocalSDicts get category get /lsdict exch put
} {
currentdict /LocalRDicts get category get /rdict exch def
currentdict /LocalSDicts get category get /sdict exch def
} ifelse
/inst exch readonly def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
currentdict /lrdict get /nulltype ne { % if local dict exists
currentdict /lrdict get key undef % delete any entry with
currentdict /lsdict get key undef % this key
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 -1 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
end
}
>> /Category defineresource pop
% HALFTONE
/Halftone
<<
/InstanceType /dicttype /Category /Halftone
/err $resource /err get def
/ResourceForAll {
genericresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentglobal {
currentdict /GlobalSDicts get category get /sdict exch def
sdict length 0 eq {
false
} {
sdict begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} { % local VM mode
currentdict /LocalSDicts get category get /sdict exch def
sdict length 0 eq { % 0 length local status dict -- look at glob stat dict
currentdict /GlobalSDicts get category get length 0 eq {
false % 0 length global status dict
} {
currentdict /GlobalSDicts get category get begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} { % local status dict has something in it
currentdict /LocalSDicts get category get begin
currentdict /key load known not { % not in the local stat dict
end
currentdict /GlobalSDicts get category get begin
currentdict /key load known not { % not in global stat dict
false
}{
currentdict /key load get {} forall
} ifelse
} { % found in the local dict
currentdict /key load get {} forall
} ifelse
end
} ifelse
} ifelse
$resource /key undef $resource /sdict undef
$resource /category undef
end
}
/ResourceFileName {
(Resource/Halftone/) genericresourcefile
}
/UndefineResource {
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
% always delete from local vm dictionary
currentdict /LocalRDicts get category get length 0 ne {
currentdict /LocalRDicts get category get
begin
currentdict /key load undef
end
currentdict /LocalSDicts get category get
begin
currentdict /key load undef
end
} if
currentglobal { % if global vm, delete
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
currentdict /GlobalSDicts get category get
begin
currentdict /key load undef
end
} if
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 2 lt { % too few arguments
/findencoding /stackunderflow err
} if
exch $resource exch
/key exch dup type /arraytype eq { % get the key. If it's a proc,
dup xcheck { % stuff the array into another array
1 array astore cvx % before defining key
} if
} if
put
$resource /key get type /nulltype eq { % generate a complaint if null
$resource /key get
/findencoding /typecheck err
} if
$resource /KeyAccessTest get exec % check the access of key if composite
$resource begin
/category exch def
currentglobal { % if global vm active
currentdict /GlobalRDicts get category get /rdict exch def
} { % local vm, check local vm, then global
currentdict /LocalRDicts get category get length 0 eq {
currentdict /GlobalRDicts get category get length 0 eq {
% here we will later insert code to search for files containing
% the stuff
end $resource /key get /findencoding /undefinedresource err
} if
currentdict /GlobalRDicts get category get /rdict exch def
} {
currentdict /LocalRDicts get category get /rdict exch def
} ifelse
} ifelse
rdict begin
currentdict $resource /key get known not { % didn't find in the first dict search
end
currentglobal { % if global vm, all done
% here we will later insert code to search for files containing
% the stuff. Be sure to update the ResourceStatusDict also !!
end $resource /key get /findencoding /undefinedresource err
} if
currentdict /GlobalRDicts get category get length 0 eq {
end $resource /key get /findencoding /undefinedresource err % all done
} if
% now search the global dictionary */
currentdict /GlobalRDicts get category get /rdict exch def
rdict $resource /key get known not {
end $resource dup /key get /findencoding /undefinedresource err
} if
currentdict /rdict get
begin
} if
currentdict $resource /key get get
end
currentdict /key undef
currentdict /rdict undef
currentdict /category undef
end %$resource
}
/DefineResource {
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
currentdict /LocalRDicts get category get /lrdict exch put
currentdict /LocalSDicts get category get /lsdict exch put
} {
currentdict /LocalRDicts get category get /rdict exch def
currentdict /LocalSDicts get category get /sdict exch def
} ifelse
/inst exch readonly def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
currentdict /lrdict get /nulltype ne { % if local dict exists
currentdict /lrdict get key undef % delete any entry with
currentdict /lsdict get key undef % this key
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 -1 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
end
}
>> /Category defineresource pop
% COLORRENDERING
/ColorRendering
<<
/InstanceType /dicttype /Category /ColorRendering
/err $resource /err get def
/ResourceForAll {
genericresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentglobal {
currentdict /GlobalSDicts get category get /sdict exch def
sdict length 0 eq {
false
} {
sdict begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} { % local VM mode
currentdict /LocalSDicts get category get /sdict exch def
sdict length 0 eq { % 0 length local status dict -- look at glob stat dict
currentdict /GlobalSDicts get category get length 0 eq {
false % 0 length global status dict
} {
currentdict /GlobalSDicts get category get begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} { % local status dict has something in it
currentdict /LocalSDicts get category get begin
currentdict /key load known not { % not in the local stat dict
end
currentdict /GlobalSDicts get category get begin
currentdict /key load known not { % not in global stat dict
false
}{
currentdict /key load get {} forall
} ifelse
} { % found in the local dict
currentdict /key load get {} forall
} ifelse
end
} ifelse
} ifelse
$resource /key undef $resource /sdict undef
$resource /category undef
end
}
/ResourceFileName {
(Resource/ColorRendering/) genericresourcefile
}
/UndefineResource {
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
% always delete from local vm dictionary
currentdict /LocalRDicts get category get length 0 ne {
currentdict /LocalRDicts get category get
begin
currentdict /key load undef
end
currentdict /LocalSDicts get category get
begin
currentdict /key load undef
end
} if
currentglobal { % if global vm, delete
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
currentdict /GlobalSDicts get category get
begin
currentdict /key load undef
end
} if
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 2 lt { % too few arguments
/findencoding /stackunderflow err
} if
exch $resource exch
/key exch dup type /arraytype eq { % get the key. If it's a proc,
dup xcheck { % stuff the array into another array
1 array astore cvx % before defining key
} if
} if
put
$resource /key get type /nulltype eq { % generate a complaint if null
$resource /key get
/findencoding /typecheck err
} if
$resource /KeyAccessTest get exec % check the access of key if composite
$resource begin
/category exch def
currentglobal { % if global vm active
currentdict /GlobalRDicts get category get /rdict exch def
} { % local vm, check local vm, then global
currentdict /LocalRDicts get category get length 0 eq {
currentdict /GlobalRDicts get category get length 0 eq {
% here we will later insert code to search for files containing
% the stuff
end $resource /key get /findencoding /undefinedresource err
} if
currentdict /GlobalRDicts get category get /rdict exch def
} {
currentdict /LocalRDicts get category get /rdict exch def
} ifelse
} ifelse
rdict begin
currentdict $resource /key get known not { % didn't find in the first dict search
end
currentglobal { % if global vm, all done
% here we will later insert code to search for files containing
% the stuff. Be sure to update the ResourceStatusDict also !!
end $resource /key get /findencoding /undefinedresource err
} if
currentdict /GlobalRDicts get category get length 0 eq {
end $resource /key get /findencoding /undefinedresource err % all done
} if
% now search the global dictionary */
currentdict /GlobalRDicts get category get /rdict exch def
rdict $resource /key get known not {
end $resource dup /key get /findencoding /undefinedresource err
} if
currentdict /rdict get
begin
} if
currentdict $resource /key get get
end
currentdict /key undef
currentdict /rdict undef
currentdict /category undef
end %$resource
}
/DefineResource {
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
currentdict /LocalRDicts get category get /lrdict exch put
currentdict /LocalSDicts get category get /lsdict exch put
} {
currentdict /LocalRDicts get category get /rdict exch def
currentdict /LocalSDicts get category get /sdict exch def
} ifelse
/inst exch readonly def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
currentdict /lrdict get /nulltype ne { % if local dict exists
currentdict /lrdict get key undef % delete any entry with
currentdict /lsdict get key undef % this key
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 -1 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
end
}
>> /Category defineresource pop
% Implicit Resources
% FILTER
/Filter
<<
/InstanceType /nametype /Category /Filter
/err $resource /err get def
/ResourceForAll {
genericresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalSDicts get category get length 0 eq {
false
} {
currentdict /GlobalSDicts get category get
begin
currentdict key known not {
false
} {
currentdict key get {} forall
} ifelse
end
} ifelse
$resource dup /key undef /category undef
end
}
/UndefineResource {
$resource /initialize known not {
/UndefineResource /invalidaccess err
} if
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 1 lt {
/FindResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get
begin
currentdict key known not {
end end /FindResource /undefinedresource err
} if
currentdict key get
end % on the resource
currentdict /key undef
currentdict /category undef
end % on $resource
}
/DefineResource {
$resource /initialize known not {
/DefineResource /invalidaccess err
} if
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
} {
end /DefineResource /invalidaccess err
} ifelse
/inst exch def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 0 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
end
}
>> /Category defineresource pop
% COLORSPACEFAMILY
/ColorSpaceFamily
<<
/InstanceType /nametype /Category /ColorSpaceFamily
/err $resource /err get def
/ResourceForAll {
genericresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalSDicts get category get length 0 eq {
false
} {
currentdict /GlobalSDicts get category get
begin
currentdict key known not {
false
} {
currentdict key get {} forall
} ifelse
end
} ifelse
$resource dup /key undef /category undef
end
}
/UndefineResource {
$resource /initialize known not {
/UndefineResource /invalidaccess err
} if
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 1 lt {
/FindResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get
begin
currentdict key known not {
end end /FindResource /undefinedresource err
} if
currentdict key get
end % on the resource
currentdict /key undef
currentdict /category undef
end % on $resource
}
/DefineResource {
$resource /initialize known not {
/DefineResource /invalidaccess err
} if
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
} {
end /DefineResource /invalidaccess err
} ifelse
/inst exch def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 0 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
currentdict /category undef currentdict /insttype undef
end
}
>> /Category defineresource pop
% EMULATOR
/Emulator
<<
/InstanceType /nametype /Category /Emulator
/err $resource /err get def
/ResourceForAll {
genericresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalSDicts get category get length 0 eq {
false
} {
currentdict /GlobalSDicts get category get
begin
currentdict key known not {
false
} {
currentdict key get {} forall
} ifelse
end
} ifelse
$resource dup /key undef /category undef
end
}
/UndefineResource {
$resource /initialize known not {
/UndefineResource /invalidaccess err
} if
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 1 lt {
/FindResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get
begin
currentdict key known not {
end end /FindResource /undefinedresource err
} if
currentdict key get
end % on the resource
currentdict /key undef
currentdict /category undef
end % on $resource
}
/DefineResource {
$resource /initialize known not {
/DefineResource /invalidaccess err
} if
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
} {
end /DefineResource /invalidaccess err
} ifelse
/inst exch def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 0 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
currentdict /category undef currentdict /insttype undef
end
}
>> /Category defineresource pop
% IODEVICE
/IODevice
<<
/InstanceType /stringtype /Category /IODevice
/err $resource /err get def
/ResourceForAll {
genericresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalSDicts get category get length 0 eq {
false
} {
currentdict /GlobalSDicts get category get
begin
currentdict key known not {
false
} {
currentdict key get {} forall
} ifelse
end
} ifelse
$resource dup /key undef /category undef
end
}
/UndefineResource {
$resource /initialize known not {
/UndefineResource /invalidaccess err
} if
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 1 lt {
/FindResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get
begin
currentdict key known not {
end end /FindResource /undefinedresource err
} if
currentdict key get
end % on the resource
currentdict /key undef
currentdict /category undef
end % on $resource
}
/DefineResource {
$resource /initialize known not {
/DefineResource /invalidaccess err
} if
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
} {
end /DefineResource /invalidaccess err
} ifelse
/inst exch def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 0 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
end
}
>> /Category defineresource pop
% COLORRENDERINGTYPE
/ColorRenderingType
<<
/InstanceType /integertype /Category /ColorRenderingType
/err $resource /err get def
/ResourceForAll {
implicitresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalSDicts get category get length 0 eq {
false
} {
currentdict /GlobalSDicts get category get
begin
currentdict key known not {
false
} {
currentdict key get {} forall
} ifelse
end
} ifelse
$resource dup /key undef /category undef
end
}
/UndefineResource {
$resource /initialize known not {
/UndefineResource /invalidaccess err
} if
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 1 lt {
/FindResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get
begin
currentdict key known not {
end end /FindResource /undefinedresource err
} if
currentdict key get
end % on the resource
currentdict /key undef
currentdict /category undef
end % on $resource
}
/DefineResource {
$resource /initialize known not {
/DefineResource /invalidaccess err
} if
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
} {
end /DefineResource /invalidaccess err
} ifelse
/inst exch def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 0 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
currentdict /category undef currentdict /insttype undef
end
}
>> /Category defineresource pop
% FMAPTYPE
/FMapType
<<
/InstanceType /integertype /Category /FMapType
/err $resource /err get def
/ResourceForAll {
implicitresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
/key exch def
$resource /key get type $resource /insttype get ne {
end /ResourceStatus /typecheck err
} if
currentdict /GlobalSDicts get category get length 0 eq {
false
} {
currentdict /GlobalSDicts get category get
begin
currentdict key known not {
false
} {
currentdict key get {} forall
} ifelse
end
} ifelse
$resource dup /key undef /category undef
$resource /insttype undef
end
}
/UndefineResource {
$resource /initialize known not {
/UndefineResource /invalidaccess err
} if
count 2 lt {
/UndefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
/key exch def
$resource /key get type $resource /insttype get ne {
end /UndefineResource /typecheck err
} if
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 1 lt {
/FindResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get
begin
currentdict key known not {
end end /FindResource /undefinedresource err
} if
currentdict key get
end % on the resource
currentdict /key undef
currentdict /category undef
end % on $resource
}
/DefineResource {
$resource /initialize known not {
/DefineResource /invalidaccess err
} if
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
} {
end /DefineResource /invalidaccess err
} ifelse
/inst exch def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 0 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
currentdict /category undef currentdict /insttype undef
end
}
>> /Category defineresource pop
% FONTTYPE
/FontType
<<
/InstanceType /integertype /Category /FontType
/err $resource /err get def
/ResourceForAll {
implicitresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalSDicts get category get length 0 eq {
false
} {
currentdict /GlobalSDicts get category get
begin
currentdict key known not {
false
} {
currentdict key get {} forall
} ifelse
end
} ifelse
$resource dup /key undef /category undef
end
}
/UndefineResource {
$resource /initialize known not {
/UndefineResource /invalidaccess err
} if
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 1 lt {
/FindResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get
begin
currentdict key known not {
end end /FindResource /undefinedresource err
} if
currentdict key get
end % on the resource
currentdict /key undef
currentdict /category undef
end % on $resource
}
/DefineResource {
$resource /initialize known not {
/DefineResource /invalidaccess err
} if
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
} {
end /DefineResource /invalidaccess err
} ifelse
/inst exch def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 0 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
currentdict /category undef currentdict /insttype undef
end
}
>> /Category defineresource pop
% FORMTYPE
/FormType
<<
/InstanceType /integertype /Category /FormType
/err $resource /err get def
/ResourceForAll {
implicitresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalSDicts get category get length 0 eq {
false
} {
currentdict /GlobalSDicts get category get
begin
currentdict key known not {
false
} {
currentdict key get {} forall
} ifelse
end
} ifelse
$resource dup /key undef /category undef
end
}
/UndefineResource {
$resource /initialize known not {
/UndefineResource /invalidaccess err
} if
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 1 lt {
/FindResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get
begin
currentdict key known not {
end end /FindResource /undefinedresource err
} if
currentdict key get
end % on the resource
currentdict /key undef
currentdict /category undef
end % on $resource
}
/DefineResource {
$resource /initialize known not {
/DefineResource /invalidaccess err
} if
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
} {
end /DefineResource /invalidaccess err
} ifelse
/inst exch def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 0 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
currentdict /category undef currentdict /insttype undef
end
}
>> /Category defineresource pop
% HALFTONETYPE
/HalftoneType
<<
/InstanceType /integertype /Category /HalftoneType
/err $resource /err get def
/ResourceForAll {
implicitresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalSDicts get category get length 0 eq {
false
} {
currentdict /GlobalSDicts get category get
begin
currentdict key known not {
false
} {
currentdict key get {} forall
} ifelse
end
} ifelse
$resource dup /key undef /category undef
end
}
/UndefineResource {
$resource /initialize known not {
/UndefineResource /invalidaccess err
} if
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 1 lt {
/FindResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get
begin
currentdict key known not {
end end /FindResource /undefinedresource err
} if
currentdict key get
end % on the resource
currentdict /key undef
currentdict /category undef
end % on $resource
}
/DefineResource {
$resource /initialize known not {
/DefineResource /invalidaccess err
} if
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
} {
end /DefineResource /invalidaccess err
} ifelse
/inst exch def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 0 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
currentdict /category undef currentdict /insttype undef
end
}
>> /Category defineresource pop
% IMAGETYPE
/ImageType
<<
/InstanceType /integertype /Category /ImageType
/err $resource /err get def
/ResourceForAll {
implicitresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalSDicts get category get length 0 eq {
false
} {
currentdict /GlobalSDicts get category get
begin
currentdict key known not {
false
} {
currentdict key get {} forall
} ifelse
end
} ifelse
$resource dup /key undef /category undef
end
}
/UndefineResource {
$resource /initialize known not {
/UndefineResource /invalidaccess err
} if
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 1 lt {
/FindResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get
begin
currentdict key known not {
end end /FindResource /undefinedresource err
} if
currentdict key get
end % on the resource
currentdict /key undef
currentdict /category undef
end % on $resource
}
/DefineResource {
$resource /initialize known not {
/DefineResource /invalidaccess err
} if
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
} {
end /DefineResource /invalidaccess err
} ifelse
/inst exch def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 0 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
currentdict /category undef currentdict /insttype undef
end
}
>> /Category defineresource pop
true setglobal
% GENERIC
/Generic
<<
/Category /Generic
/err $resource /err get def
/ResourceForAll {
genericresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentglobal {
currentdict /GlobalSDicts get category get /sdict exch def
sdict length 0 eq {
false
} {
sdict begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} {
currentdict /LocalSDicts get category get /sdict exch def
sdict length 0 eq {
currentdict /GlobalSDicts get category known not {
false
} {
currentdict /GlobalSDicts get category get length 0 eq {
false
} {
currentdict /GlobalSDicts get category get begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} ifelse
} {
currentdict /LocalSDicts get category get length 0 eq {
false
} {
currentdict /LocalSDicts get category get begin
currentdict /key load known not {
false
} {
currentdict /key load get {} forall
} ifelse
end
} ifelse
} ifelse
} ifelse
$resource /key undef $resource /sdict undef
$resource /category undef
end
}
/ResourceFileName {
(Resource/Generic/) genericresourcefile
}
/UndefineResource {
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
% always delete from local vm dictionary
currentdict /LocalRDicts get category get length 0 ne {
currentdict /LocalRDicts get category get
begin
currentdict /key load undef
end
currentdict /LocalSDicts get category get
begin
currentdict /key load undef
end
} if
currentglobal { % if global vm, delete
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
currentdict /GlobalSDicts get category get
begin
currentdict /key load undef
end
} if
} if
currentdict dup /key undef /category undef
end
}
/KeyAccessTest {
/matched false def
[/arraytype /stringtype /packedarraytype /dicttype /filetype]
{key type eq matched or /matched exch def } forall
matched {
key rcheck not {
currentdict /matched undef
key currentdict /key undef
/findencoding /invalidaccess err
} if
} if
currentdict /matched undef
} def
/FindResource {
count 2 lt { % too few arguments
/findencoding /stackunderflow err
} if
exch $resource exch
/key exch dup type /arraytype eq { % get the key. If it's a proc,
dup xcheck { % stuff the array into another array
1 array astore cvx % before defining key
} if
} if
put
$resource /key get type /nulltype eq { % generate a complaint if null
$resource /key get
/findencoding /typecheck err
} if
$resource /KeyAccessTest get exec % check the access of key if composite
$resource begin
/category exch def
currentglobal { % if global vm active
currentdict /GlobalRDicts get category get /rdict exch def
} { % local vm, check local vm, then global
currentdict /LocalRDicts get category get length 0 eq {
currentdict /GlobalRDicts get category get length 0 eq {
% here we will later insert code to search for files containing
% the stuff
end $resource /key get /findencoding /undefinedresource err
} if
currentdict /GlobalRDicts get category get /rdict exch def
} {
currentdict /LocalRDicts get category get /rdict exch def
} ifelse
} ifelse
rdict begin
currentdict /key load known not { % didn't find in the first dict search
end %end of rdict
currentglobal { % if global vm, all done
% here we will later insert code to search for files containing
% the stuff. Be sure to update the ResourceStatusDict also !!
end $resource /key get /findencoding /undefinedresource err
} if
currentdict /GlobalRDicts get category get length 0 eq {
end /key load /findencoding /undefinedresource err % all done
} if
% now search the global dictionary */
currentdict /GlobalRDicts get category get /rdict exch def
rdict /key load known not {
end $resource /key get /findencoding /undefinedresource err
} if
currentdict /rdict get
begin
} if
currentdict /key load get
end
currentdict /key undef
currentdict /rdict undef
currentdict /category undef
end %$resource
}
/DefineResource {
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType known not {
$resource /instflag false put
} {
currentdict /InstanceType get
$resource /instflag true put
} ifelse
$resource begin
instflag {
/insttype exch def
} if
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
currentdict /LocalRDicts get category get /lrdict exch def
currentdict /LocalSDicts get category get /lsdict exch def
} {
currentdict /LocalRDicts get category known not {
currentdict /LocalRDicts get category 10 dict put
currentdict /LocalSDicts get category 10 dict put
} if
currentdict /LocalRDicts get category get /rdict exch def
currentdict /LocalSDicts get category get /sdict exch def
} ifelse
/inst exch def % save the instance
% make it read only if its a composite
/matched false def
[/arraytype /stringtype /packedarraytype /dicttype /filetype]
{currentdict /inst get type eq matched or /matched exch def } forall
matched {
/inst currentdict /inst get readonly def
} if
instflag { % check for correct datatype
currentdict /inst get type currentdict /insttype get ne {
end /DefineResource /typecheck err
} if
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
currentdict /lrdict get /nulltype ne { % if local dict exists
currentdict /lrdict get key undef % delete any entry with
currentdict /lsdict get key undef % this key
} if
} if
currentdict /rdict get key currentdict /inst get put % store key, inst
currentdict /sdict get key [0 -1 true] put % set status
currentdict /inst get % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
currentdict /category undef currentdict /insttype undef
currentdict /matched undef currentdict /instflag undef
end
}
>> /Category defineresource pop
% PATTERNTYPE
/PatternType
<<
/InstanceType /integertype /Category /PatternType
/err $resource /err get def
/ResourceForAll {
implicitresourceforall
}
/ResourceStatus {
count 2 lt {
/ResourceStatus /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalSDicts get category get length 0 eq {
false
} {
currentdict /GlobalSDicts get category get
begin
currentdict key known not {
false
} {
currentdict key get {} forall
} ifelse
end
} ifelse
$resource dup /key undef /category undef
end
}
/UndefineResource {
$resource /initialize known not {
/UndefineResource /invalidaccess err
} if
count 2 lt {
/UndefineResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get length 0 ne { % from global dict
currentdict /GlobalRDicts get category get
begin
currentdict /key load undef
end
} if
currentdict dup /key undef /category undef
end
}
/FindResource {
count 1 lt {
/FindResource /stackunderflow err
} if
$resource begin
/category exch def
/key exch def
currentdict /GlobalRDicts get category get
begin
currentdict key known not {
end end /FindResource /undefinedresource err
} if
currentdict key get
end % on the resource
currentdict /key undef
currentdict /category undef
end % on $resource
}
/DefineResource {
$resource /initialize known not {
/DefineResource /invalidaccess err
} if
count 3 lt { % check for enough args
/DefineResource /stackunderflow err
} if
currentdict /InstanceType get
$resource begin
/insttype exch def
/category exch def
currentglobal {
currentdict /GlobalRDicts get category get /rdict exch def
currentdict /GlobalSDicts get category get /sdict exch def
} {
end /DefineResource /invalidaccess err
} ifelse
/inst exch def % make the instance readonly
inst type currentdict /insttype get ne { % check for correct datatype
end /DefineResource /typecheck err
} if
/key exch def
currentglobal { % if true vm
currentdict /inst get gcheck not { % can't store local instance into global
end /DefineResource /invalidaccess err
} if
} if
currentdict /rdict get key inst put % store key, inst
currentdict /sdict get key [0 0 true] put % set status
inst % put instance back on stack
currentdict /inst undef currentdict /key undef % ditch local variables
currentdict /lrdict undef currentdict /lsdict undef
currentdict /rdict undef currentdict /sdict undef
currentdict /category undef currentdict /insttype undef
end
}
>> /Category defineresource pop
%% Initialize a few resources
false setglobal
/DefaultColorRendering currentcolorrendering /ColorRendering defineresource pop
/DefaultHalftone currenthalftone /Halftone defineresource pop
/DefaultColorSpace currentcolorspace /ColorSpace defineresource pop
true setglobal
(%Serial%) (%Serial%) /IODevice defineresource pop
serverdict begin /__Initialize_ 12 def end
(%Serial%) <<
/Password () /StopBits 1 /Enabled true /Baud 9600 /CheckParity false
/Type (Communications) /FlowControl (XonXoff) /HasNames false
/On true /Parity 0 /Protocol (Normal) /DataBits 8
>> setdevparams
serverdict /__Initialize_ undef
/ASCIIHexEncode /ASCIIHexEncode /Filter defineresource pop
/ASCIIHexDecode /ASCIIHexDecode /Filter defineresource pop
/ASCII85Encode /ASCII85Encode /Filter defineresource pop
/ASCII85Decode /ASCII85Decode /Filter defineresource pop
/CCITTFaxEncode /CCITTFaxEncode /Filter defineresource pop
/CCITTFaxDecode /CCITTFaxDecode /Filter defineresource pop
/DCTEncode /DCTEncode /Filter defineresource pop
/DCTDecode /DCTDecode /Filter defineresource pop
/LZWEncode /LZWEncode /Filter defineresource pop
/LZWDecode /LZWDecode /Filter defineresource pop
/RunLengthEncode /RunLengthEncode /Filter defineresource pop
/RunLengthDecode /RunLengthDecode /Filter defineresource pop
/SubFileDecode /SubFileDecode /Filter defineresource pop
/NullEncode /NullEncode /Filter defineresource pop
/Separation /Separation /ColorSpaceFamily defineresource pop
/Pattern /Pattern /ColorSpaceFamily defineresource pop
/Indexed /Indexed /ColorSpaceFamily defineresource pop
/CIEBasedABC /CIEBasedABC /ColorSpaceFamily defineresource pop
/CIEBasedA /CIEBasedA /ColorSpaceFamily defineresource pop
/DeviceGray /DeviceGray /ColorSpaceFamily defineresource pop
/DeviceRGB /DeviceRGB /ColorSpaceFamily defineresource pop
/DeviceCMYK /DeviceCMYK /ColorSpaceFamily defineresource pop
2 2 /FMapType defineresource pop
3 3 /FMapType defineresource pop
4 4 /FMapType defineresource pop
5 5 /FMapType defineresource pop
6 6 /FMapType defineresource pop
7 7 /FMapType defineresource pop
8 8 /FMapType defineresource pop
1 1 /PatternType defineresource pop
1 1 /ImageType defineresource pop
1 1 /FormType defineresource pop
1 1 /ColorRenderingType defineresource pop
1 1 /HalftoneType defineresource pop
2 2 /HalftoneType defineresource pop
3 3 /HalftoneType defineresource pop
4 4 /HalftoneType defineresource pop
5 5 /HalftoneType defineresource pop
/Type0 0 /FontType defineresource pop
/Type1 1 /FontType defineresource pop
/Type3 3 /FontType defineresource pop
/Type4 4 /FontType defineresource pop
/Type5 5 /FontType defineresource pop
true setglobal
/StandardEncoding StandardEncoding /Encoding defineresource pop
/ISOLatin1Encoding ISOLatin1Encoding /Encoding defineresource pop
false setglobal
$resource /initialize undef
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% from setpd1.ps %%%%%%%%%%%%%%%%%%%%%%%%%
% Setup for the page device
true setglobal
statusdict begin /defaultpddict1
<<
/Policies <<
/PolicyNotFound 1
/MediaColor 1
/MediaType 1
/MediaWeight 0
/PageSize 3
/PolicyReport {pop}
>>
>> def
/defaultpddict2
<<
/NumCopies null
/ManualFeed false
/ImagingBBox null
/HWResolution [ 72 72 ]
/Policies <<
/PolicyNotFound 1
/MediaColor 1
/MediaType 1
/MediaWeight 0
/PageSize 3
/PolicyReport {pop}
>>
/PageSize [612 792]
/PageMargins [0 0 0 0]
/ImagingModel 0
/GrayScale false
/InputAttributes <<
0 <</PageSize [612 792] >> % A
1 <</PageSize [612 864] >> % Along
2 <</PageSize [595 842] >> % A4
3 <</PageSize [612 864] >> % A4long
4 <</PageSize [842 1191] >> % A3
5 <</PageSize [643 1009] >> % SuperA
6 <</PageSize [612 1008] >> % Legal
7 <</PageSize [792 1224] >> % B
8 <</PageSize [864 1380] >> % SuperB
9 <</PageSize [2304 2304] >> % Corel MaxPage
/Priority [0 1 2 3 4 5 6 7 8 9]
>>
/OutputAttributes <<
/Separations false
>>
/Install {}
/BeginPage {pop }
/EndPage {exch pop 2 ne }
>> def
false setglobal
statusdict begin
/gentray {
<< /Policies << /PageSize 0 >> >> setpagedevice
statusdict begin
/trayname exch def
/traydict 5 dict def
traydict begin
/PageMargins exch def
/ImagingBBox exch def
/PageSize exch def
end
traydict { setpagedevice } stopped {
$error begin
/newerror true def
/errorname /rangecheck def
/command trayname cvs def
end stop
} if
end
} def
/genpaper {
<< /Policies << /PageSize 7>> >> setpagedevice
statusdict begin
/traydict 5 dict def
traydict begin
/PageMargins exch def
/Margins exch def
/ImagingBBox exch def
/PageSize exch def
end
traydict setpagedevice
end
} def
end
/setuppd { statusdict /defaultpddict1 get setpagedevice statusdict /defaultpddict2 get setpagedevice } def
end
% statusdict /setuppd get exec